﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>考试页面</title>
    <link href="../css/Exam.css" rel="stylesheet" type="text/css" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/Jqbox.css" rel="stylesheet" type="text/css" />
    <link href="../css/jquery.loadmask.css" rel="stylesheet" type="text/css" />
    <script src="../Js/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../Js/ligerui.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.dialog.js" type="text/javascript"></script>
    <script src="../Js/jquery.loadmask.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.lwtCountdown.js" type="text/javascript"></script>
    <script src="../Js/json2.js" type="text/javascript"></script>
    <script src="../Js/conmon.js" type="text/javascript"></script>
    <script src="../Js/Exam/CreateExam.js" type="text/javascript"></script>
    <style type="text/css">
  
        *{word-wrap:break-word;}
        .cl:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
        .cl{zoom:1;}hr{display:block;clear:both;*margin-top:-8px !important;*margin-bottom:-8px !important;}
        .altw{width:700px;}
        .altw .fltc{margin-bottom:0;padding:8px;}

        .wp{margin:0 auto;width:960px;}
        #wp .wp{width:auto;}

 
         .f_c{}.f_c li{list-style:none;}
         .f_c hr.l{margin:0;}
         .f_c a{color:#4D7189;}
         .f_c .list{margin:0 auto 10px;width:570px;border-top:3px solid #CDCDCD;}
         .f_c .list th,.f_c .list td{padding:5px 2px;height:auto;border-bottom:1px dashed #CDCDCD;}
         .f_c .list .btns th,.f_c .list .btns td{border-bottom:none;}
         .f_c .th th,.f_c .th td{padding:10px 0;}
         .f_c .list th{background:none;}.nfl{height:auto !important;height:320px;min-height:320px;}
         .nfl .f_c{margin:60px auto;padding:20px;width:680px;border:3px solid #F2F2F2;background:#FFF;}
         .nfl .loginform{height:auto;}
         .nfl .clause{width:auto;height:auto;}
 

        .wrap{width:100%;margin:0 auto;}
        .wpRight{width:245px;float:right;}
        .wpLeft{width:100%;float:left;}

         #countdown_dashboard {
	        MARGIN: auto; WIDTH: 220px; BACKGROUND: url() #0A0A0A no-repeat 0px 0px; HEIGHT: 66px
        }
            .dash {
	            POSITION: relative; MARGIN-TOP: 10px; PADDING-LEFT: 23px; WIDTH: 45px; FLOAT: left; HEIGHT: 30px; COLOR: white; MARGIN-LEFT: 2px
            }
            .dash .digit {
	            POSITION: relative; TEXT-ALIGN: center; WIDTH: 16px; FONT: bold 14pt Verdana; FLOAT: left
            }
            .dash_title {
	            TEXT-ALIGN: left; PADDING-LEFT: 3px; DISPLAY: block; COLOR: #bdf; FONT-SIZE: 8pt
            }
            .info_message {
	            BORDER-BOTTOM: #34779a 2px solid; TEXT-ALIGN: center; BORDER-LEFT: #34779a 2px solid; PADDING-BOTTOM: 5px; BACKGROUND-COLOR: #0e4e6f; MARGIN: 10px auto auto; PADDING-LEFT: 5px; WIDTH: 200px; PADDING-RIGHT: 5px; BORDER-TOP: #34779a 2px solid; BORDER-RIGHT: #34779a 2px solid; PADDING-TOP: 5px
            }
              .edittable td.editcellmessage,.edittable td.editcellverify,.edittable td.editcell{ padding:3px;line-height:23px;}
                .edittable td.editcellmessage{ padding-left:0px;} 
           body{ -moz-user-select: none;}
    </style>
</head>
<body onselectstart="return false">

<table width="100%">
<tr>
  <td style="width:210px">
  
  
            <!--left -->
         
            <table cellpadding="0" border="0" cellspacing="0" class="edittable">
             <tr>
               <td class="editcellmessage">考场：<label id="lbexamname"></label></td>
             </tr>
            
             <tr>
              <td class="editcellmessage" style="color:Red">答题时间:<label id="lbtotaltime"></label>分钟</td>
            </tr>
            <tr>
              <td class="editcellmessage" style="color:Red">总共:<label id="lbcountTopic"></label>题</td>
            </tr>
              <tr>
              <td class="editcellmessage">总分:<label id="totalscore"></label></td>
             </tr>
              <tr>
               <td class="editcellmessage">考试人:<label id="lbusername"></label></td>
             </tr>
              <tr>
                <td class="editcellmessage">计时：

                <div id="countdown_dashboard">
                <div class="dash hours_dash">
					<span class="dash_title">小时</span>
					<div class="digit">0</div>
					<div class="digit">0</div>
				</div>

                    <div class="dash minutes_dash"><span class="dash_title">分钟</span> 
                    <div class="digit">0</div>
                    <div class="digit">0</div></div>

                    <div class="dash seconds_dash"><span class="dash_title">秒钟</span> 
                    <div class="digit">0</div>
                    <div class="digit">0</div></div>
                  </div>
                </td>
              </tr>
               <tr>
               <td class="editcellmessage">&nbsp;
               </td>
               </tr>
            <tr>
               <td class="editcellmessage">
                 <a  id="mysubmit" class="l-button" style="width:120px; float:left; margin-left:30px;"   onclick="onSubmitEx()">我要交卷</a>&nbsp;
               </td>
            </tr>
            </table>

 
            </td>
  <td>
  

            <!-- end left -->
       
              <!-- 提示-->
              <div id="dpcontent" class="dpcontent wrap">
               <div style="padding:10px 30px 0;">
                 <div  class="main" style="margin: 0pt auto ! important; width: 100%;">
                            <div id="ct" class="wp cl w">
                               <div id="main_message" class="nfl" style="padding-top:50px;">
                                    <div class="f_c altw" style="margin:0 auto;">
                                      <table cellpadding="0" border="0" cellspacing="0" class="edittable">
                                        <tr>
                                         <td  class="editcellmessage">
                                             网络考试系统不许刷新，不许后退，否则后果自负。如果在规定的考试时间内没有交卷，系统会自动提交。 
                                         </td>
                                         </tr>
                                         <tr >
                                           <td class="editcellmessage">
                                           <!--没有试题的试卷是不会让考生选的，所以如果没有找到你想要考的试卷不要着急，请联系管理员。-->
                                           </td>
                                         </tr>
                                         <tr>
                                           <td class="editcellmessage">
                                             <!--如果没问题，点下开始考试按钮，那么就开始计时进行考试-->
                                           </td>
                                         </tr>
                                         <tr>
                                           <td class="editcellmessage">
                                                 <a  class="l-button" style="width:200px; float:left; margin-left:30px;"   onclick="Start()">开始考试</a>&nbsp;
                                           </td>
                                         </tr>
                                      </table>
                                  </div>
                                </div>
                              </div>
                         </div>
                    </div>
             </div>
             <!--end  提示-->
             <!-- 出题-->
             <div id="showSj" style=" width:100%; overflow-y:scroll;display:inline-block;">
            
                <div id="ExamContent">
                   <div class="E_E_L_I_C_Right">
                      <div id="subViewID1" class="E_E_L_I_C_R_SubView">
                           <div class="E_E_L_I_C_R_Content">
                             
                             </div>
                           </div>
                      </div>
                   </div>
                 
               </div>
              <!-- end 出题-->
           
  </td>
</tr>
</table>
<div id="dzTopicDiv" style=" direction:none;">
    
</div>

<script type="text/javascript">
    var autoRun = null;
    var numAll = 0;
    function changeText() {

        clearText();
        var txt = $("#txtInput").val();
        txt = txt.replace(/\r\n/g, '\n');
        var divTxt = getObj('divText').innerHTML;
        divTxt = divTxt.replace(/  /g, ' ');
        divTxt = divTxt.replace(/   /g, ' ');
        divTxt = divTxt.replace(/\r/g, '');
        divTxt = divTxt.replace(/\n/g, '');
        divTxt = divTxt.replace(/&nbsp;/g, ' ');
        divTxt = divTxt.replace(/<BR>/g, '\n');
        divTxt = divTxt.replace(/<br>/g, '\n');
        var top = 18;
        var left = 0;
        var error = 0;
        var lost = 0;
        var spanObj = null;
        for (var i = 0; i < divTxt.length; i++) {
            if (i >= txt.length + lost) {
                break;
            }

            var color = 'green';
            if (txt.charAt(i - lost) != divTxt.charAt(i)) {
                error++;
                color = 'red';
            }
            else {

            }
            if (spanObj && spanObj.color != color) {
                addSpan(spanObj);
                spanObj = null;
            }

            if (divTxt.charAt(i) == '\n' || divTxt.charAt(i) == '\r') {
                if (divTxt.charAt(i) == '\n') {
                    top += 60;
                    left = 0;
                    addSpan(spanObj);
                    spanObj = null;
                }
                continue;
            }

            var charWidth = divTxt.charCodeAt(i) > 255 ? 24 : 13;
            if (!spanObj) {
                spanObj = new Object();
                spanObj.top = top;
                spanObj.left = left;
                spanObj.color = color;
                spanObj.height = 24;
                spanObj.width = charWidth;
            }
            else {
                spanObj.width += charWidth;
            }

            left += charWidth;
            if (left > 800 - charWidth) {
                top += 60;
                left = 0;
                addSpan(spanObj);
                spanObj = null;
                if (divTxt.charAt(i + 1) == ' ' || divTxt.charAt(i + 1) == '\n') {
                    i++;
                    lost++;
                }
            }
        }
        if (spanObj) {
            addSpan(spanObj);
            spanObj = null;
        }
        getObj('spanError').innerHTML = error;
        getObj('spanNum').innerHTML = txt.length;


        var temp = (txt.length - error) / numAll;
        getObj('spanRate').innerHTML = Math.round(temp * 100);

    }

    function addSpan(spanObj) {
        if (!spanObj) {
            return;
        }
        var span = document.createElement('span');
        span.style.position = 'absolute';
        span.style.width = spanObj.width + 'px';
        span.style.height = spanObj.height + 'px';
        span.style.top = spanObj.top + 'px';
        span.style.left = spanObj.left + 'px';
        span.style.zIndex = 1;
        span.style.backgroundColor = spanObj.color;
        getObj('divMain').appendChild(span);
    }

    function selectText() {
        if ($("#txtCh1").size() > 0) {
            var txt = getObj('txtCh1').value;
            txt = txt.replace(/\r/g, '');
            txt = txt.replace(/–/g, '-');
            txt = txt.replace(/\n/g, '<br>');
            var divText = getObj('divText');
            txt = txt.replace(/  /g, ' ');
            txt = txt.replace(/   /g, ' ');
            divText.innerHTML = txt;
            numAll = txt.length;
            getObj('spanAllNum').innerHTML = txt.length;
            clearText();
            $("#txtInput").height(Math.max(500, divText.offsetHeight));
            $("#txtInput").val("");
            $("#txtInput").attr("disabled", "");
            $("#txtInput").focus();

            getObj('spanError').innerHTML = '0';
            getObj('spanRate').innerHTML = '0';

            getObj('spanNum').innerHTML = '0';
            getObj('txtInput').value = '';
        }

    }


    function clearText() {
        var divMain = getObj('divMain');
        var spans = divMain.getElementsByTagName('span');
        while (spans.length > 0) {
            divMain.removeChild(spans[0]);
        }
    }
    function getObj(id) {
        return document.getElementById(id);
    }

</script>

</body>
</html>
